#!/usr/bin/env python
#
# Copyright 2010 myenergyuse
# http://code.google.com/p/myenergyuse/
# watchmyted - at- gmail.com
#
""" Database """

from google.appengine.ext import db

class UserPreferences(db.Model):
  created = db.DateTimeProperty(auto_now_add=True)
  updated = db.DateTimeProperty(auto_now=True)    
  owner = db.UserProperty()
 

class Meter(db.Model):
  meterID = db.IntegerProperty()    
  name = db.StringProperty(multiline=False)
  Reading15MinuteBySecond_timestamp = db.StringProperty(multiline=False)
  ReadingForHourByMinute_timestamp = db.StringProperty(multiline=False)
  ReadingForDayBy15Minute_timestamp = db.StringProperty(multiline=False)
  ReadingForDayByHour_timestamp = db.StringProperty(multiline=False)
  created = db.DateTimeProperty(auto_now_add=True)
  updated = db.DateTimeProperty(auto_now=True)  
  owner = db.UserProperty()
  
  
class ReadingForDayByHour(db.Model):
  meterID = db.IntegerProperty()     
  timestamp = db.StringProperty(multiline=False)
  uom = db.StringProperty(choices=set(["W", "Wh"]))
  i0 = db.IntegerProperty(default=-1)
  i1 = db.IntegerProperty(default=-1)
  i2 = db.IntegerProperty(default=-1)
  i3 = db.IntegerProperty(default=-1)
  i4 = db.IntegerProperty(default=-1)
  i5 = db.IntegerProperty(default=-1)
  i6 = db.IntegerProperty(default=-1)
  i7 = db.IntegerProperty(default=-1)
  i8 = db.IntegerProperty(default=-1)
  i9 = db.IntegerProperty(default=-1)
  i10 = db.IntegerProperty(default=-1)
  i11 = db.IntegerProperty(default=-1)
  i12 = db.IntegerProperty(default=-1)
  i13 = db.IntegerProperty(default=-1)
  i14 = db.IntegerProperty(default=-1)
  i15 = db.IntegerProperty(default=-1)
  i16 = db.IntegerProperty(default=-1)
  i17 = db.IntegerProperty(default=-1)
  i18 = db.IntegerProperty(default=-1)
  i19 = db.IntegerProperty(default=-1)
  i20 = db.IntegerProperty(default=-1)
  i21 = db.IntegerProperty(default=-1)
  i22 = db.IntegerProperty(default=-1)
  i23 = db.IntegerProperty(default=-1)
  created = db.DateTimeProperty(auto_now_add=True)
  updated = db.DateTimeProperty(auto_now=True)  
  owner = db.UserProperty()
  
    
class ReadingForDayBy15Minute(db.Model):
  meterID = db.IntegerProperty()     
  timestamp = db.StringProperty(multiline=False)
  uom = db.StringProperty(choices=set(["W", "Wh"]))
  i0 = db.IntegerProperty(default=-1)
  i1 = db.IntegerProperty(default=-1)
  i2 = db.IntegerProperty(default=-1)
  i3 = db.IntegerProperty(default=-1)
  i4 = db.IntegerProperty(default=-1)
  i5 = db.IntegerProperty(default=-1)
  i6 = db.IntegerProperty(default=-1)
  i7 = db.IntegerProperty(default=-1)
  i8 = db.IntegerProperty(default=-1)
  i9 = db.IntegerProperty(default=-1)
  i10 = db.IntegerProperty(default=-1)
  i11 = db.IntegerProperty(default=-1)
  i12 = db.IntegerProperty(default=-1)
  i13 = db.IntegerProperty(default=-1)
  i14 = db.IntegerProperty(default=-1)
  i15 = db.IntegerProperty(default=-1)
  i16 = db.IntegerProperty(default=-1)
  i17 = db.IntegerProperty(default=-1)
  i18 = db.IntegerProperty(default=-1)
  i19 = db.IntegerProperty(default=-1)
  i20 = db.IntegerProperty(default=-1)
  i21 = db.IntegerProperty(default=-1)
  i22 = db.IntegerProperty(default=-1)
  i23 = db.IntegerProperty(default=-1)
  i24 = db.IntegerProperty(default=-1)
  i25 = db.IntegerProperty(default=-1)
  i26 = db.IntegerProperty(default=-1)
  i27 = db.IntegerProperty(default=-1)
  i28 = db.IntegerProperty(default=-1)
  i29 = db.IntegerProperty(default=-1)
  i30 = db.IntegerProperty(default=-1)
  i31 = db.IntegerProperty(default=-1)
  i32 = db.IntegerProperty(default=-1)
  i33 = db.IntegerProperty(default=-1)
  i34 = db.IntegerProperty(default=-1)
  i35 = db.IntegerProperty(default=-1)
  i36 = db.IntegerProperty(default=-1)
  i37 = db.IntegerProperty(default=-1)
  i38 = db.IntegerProperty(default=-1)
  i39 = db.IntegerProperty(default=-1)
  i40 = db.IntegerProperty(default=-1)
  i41 = db.IntegerProperty(default=-1)
  i42 = db.IntegerProperty(default=-1)
  i43 = db.IntegerProperty(default=-1)
  i44 = db.IntegerProperty(default=-1)
  i45 = db.IntegerProperty(default=-1)
  i46 = db.IntegerProperty(default=-1)
  i47 = db.IntegerProperty(default=-1)
  i48 = db.IntegerProperty(default=-1)
  i49 = db.IntegerProperty(default=-1)
  i50 = db.IntegerProperty(default=-1)
  i51 = db.IntegerProperty(default=-1)
  i52 = db.IntegerProperty(default=-1)
  i53 = db.IntegerProperty(default=-1)
  i54 = db.IntegerProperty(default=-1)
  i55 = db.IntegerProperty(default=-1)
  i56 = db.IntegerProperty(default=-1)
  i57 = db.IntegerProperty(default=-1)
  i58 = db.IntegerProperty(default=-1)
  i59 = db.IntegerProperty(default=-1)
  i60 = db.IntegerProperty(default=-1)
  i61 = db.IntegerProperty(default=-1)
  i62 = db.IntegerProperty(default=-1)
  i63 = db.IntegerProperty(default=-1)
  i64 = db.IntegerProperty(default=-1)
  i65 = db.IntegerProperty(default=-1)
  i66 = db.IntegerProperty(default=-1)
  i67 = db.IntegerProperty(default=-1)
  i68 = db.IntegerProperty(default=-1)
  i69 = db.IntegerProperty(default=-1)
  i70 = db.IntegerProperty(default=-1)
  i71 = db.IntegerProperty(default=-1)
  i72 = db.IntegerProperty(default=-1)
  i73 = db.IntegerProperty(default=-1)
  i74 = db.IntegerProperty(default=-1)
  i75 = db.IntegerProperty(default=-1)
  i76 = db.IntegerProperty(default=-1)
  i77 = db.IntegerProperty(default=-1)
  i78 = db.IntegerProperty(default=-1)
  i79 = db.IntegerProperty(default=-1)
  i80 = db.IntegerProperty(default=-1)
  i81 = db.IntegerProperty(default=-1)
  i82 = db.IntegerProperty(default=-1)
  i83 = db.IntegerProperty(default=-1)
  i84 = db.IntegerProperty(default=-1)
  i85 = db.IntegerProperty(default=-1)
  i86 = db.IntegerProperty(default=-1)
  i87 = db.IntegerProperty(default=-1)
  i88 = db.IntegerProperty(default=-1)
  i89 = db.IntegerProperty(default=-1)
  i90 = db.IntegerProperty(default=-1)
  i91 = db.IntegerProperty(default=-1)
  i92 = db.IntegerProperty(default=-1)
  i93 = db.IntegerProperty(default=-1)
  i94 = db.IntegerProperty(default=-1)
  i95 = db.IntegerProperty(default=-1)
  created = db.DateTimeProperty(auto_now_add=True)
  updated = db.DateTimeProperty(auto_now=True)
  owner = db.UserProperty() 
 

class ReadingForHourByMinute(db.Model):
  meterID = db.IntegerProperty()     
  timestamp = db.StringProperty(multiline=False)
  uom = db.StringProperty(choices=set(["W", "Wh"]))
  i0 = db.IntegerProperty(default=-1)
  i1 = db.IntegerProperty(default=-1)
  i2 = db.IntegerProperty(default=-1)
  i3 = db.IntegerProperty(default=-1)
  i4 = db.IntegerProperty(default=-1)
  i5 = db.IntegerProperty(default=-1)
  i6 = db.IntegerProperty(default=-1)
  i7 = db.IntegerProperty(default=-1)
  i8 = db.IntegerProperty(default=-1)
  i9 = db.IntegerProperty(default=-1)
  i10 = db.IntegerProperty(default=-1)
  i11 = db.IntegerProperty(default=-1)
  i12 = db.IntegerProperty(default=-1)
  i13 = db.IntegerProperty(default=-1)
  i14 = db.IntegerProperty(default=-1)
  i15 = db.IntegerProperty(default=-1)
  i16 = db.IntegerProperty(default=-1)
  i17 = db.IntegerProperty(default=-1)
  i18 = db.IntegerProperty(default=-1)
  i19 = db.IntegerProperty(default=-1)
  i20 = db.IntegerProperty(default=-1)
  i21 = db.IntegerProperty(default=-1)
  i22 = db.IntegerProperty(default=-1)
  i23 = db.IntegerProperty(default=-1)
  i24 = db.IntegerProperty(default=-1)
  i25 = db.IntegerProperty(default=-1)
  i26 = db.IntegerProperty(default=-1)
  i27 = db.IntegerProperty(default=-1)
  i28 = db.IntegerProperty(default=-1)
  i29 = db.IntegerProperty(default=-1)
  i30 = db.IntegerProperty(default=-1)
  i31 = db.IntegerProperty(default=-1)
  i32 = db.IntegerProperty(default=-1)
  i33 = db.IntegerProperty(default=-1)
  i34 = db.IntegerProperty(default=-1)
  i35 = db.IntegerProperty(default=-1)
  i36 = db.IntegerProperty(default=-1)
  i37 = db.IntegerProperty(default=-1)
  i38 = db.IntegerProperty(default=-1)
  i39 = db.IntegerProperty(default=-1)
  i40 = db.IntegerProperty(default=-1)
  i41 = db.IntegerProperty(default=-1)
  i42 = db.IntegerProperty(default=-1)
  i43 = db.IntegerProperty(default=-1)
  i44 = db.IntegerProperty(default=-1)
  i45 = db.IntegerProperty(default=-1)
  i46 = db.IntegerProperty(default=-1)
  i47 = db.IntegerProperty(default=-1)
  i48 = db.IntegerProperty(default=-1)
  i49 = db.IntegerProperty(default=-1)
  i50 = db.IntegerProperty(default=-1)
  i51 = db.IntegerProperty(default=-1)
  i52 = db.IntegerProperty(default=-1)
  i53 = db.IntegerProperty(default=-1)
  i54 = db.IntegerProperty(default=-1)
  i55 = db.IntegerProperty(default=-1)
  i56 = db.IntegerProperty(default=-1)
  i57 = db.IntegerProperty(default=-1)
  i58 = db.IntegerProperty(default=-1)
  i59 = db.IntegerProperty(default=-1)
  created = db.DateTimeProperty(auto_now_add=True)
  updated = db.DateTimeProperty(auto_now=True)  
  owner = db.UserProperty()
  
class ReadingFor15MinuteBySecond(db.Model):
  meterID = db.IntegerProperty()     
  timestamp = db.StringProperty(multiline=False)
  uom = db.StringProperty(choices=set(["W", "Wh"]))
  i0 = db.IntegerProperty(default=-1)
  i1 = db.IntegerProperty(default=-1)
  i2 = db.IntegerProperty(default=-1)
  i3 = db.IntegerProperty(default=-1)
  i4 = db.IntegerProperty(default=-1)
  i5 = db.IntegerProperty(default=-1)
  i6 = db.IntegerProperty(default=-1)
  i7 = db.IntegerProperty(default=-1)
  i8 = db.IntegerProperty(default=-1)
  i9 = db.IntegerProperty(default=-1)
  i10 = db.IntegerProperty(default=-1)
  i11 = db.IntegerProperty(default=-1)
  i12 = db.IntegerProperty(default=-1)
  i13 = db.IntegerProperty(default=-1)
  i14 = db.IntegerProperty(default=-1)
  i15 = db.IntegerProperty(default=-1)
  i16 = db.IntegerProperty(default=-1)
  i17 = db.IntegerProperty(default=-1)
  i18 = db.IntegerProperty(default=-1)
  i19 = db.IntegerProperty(default=-1)
  i20 = db.IntegerProperty(default=-1)
  i21 = db.IntegerProperty(default=-1)
  i22 = db.IntegerProperty(default=-1)
  i23 = db.IntegerProperty(default=-1)
  i24 = db.IntegerProperty(default=-1)
  i25 = db.IntegerProperty(default=-1)
  i26 = db.IntegerProperty(default=-1)
  i27 = db.IntegerProperty(default=-1)
  i28 = db.IntegerProperty(default=-1)
  i29 = db.IntegerProperty(default=-1)
  i30 = db.IntegerProperty(default=-1)
  i31 = db.IntegerProperty(default=-1)
  i32 = db.IntegerProperty(default=-1)
  i33 = db.IntegerProperty(default=-1)
  i34 = db.IntegerProperty(default=-1)
  i35 = db.IntegerProperty(default=-1)
  i36 = db.IntegerProperty(default=-1)
  i37 = db.IntegerProperty(default=-1)
  i38 = db.IntegerProperty(default=-1)
  i39 = db.IntegerProperty(default=-1)
  i40 = db.IntegerProperty(default=-1)
  i41 = db.IntegerProperty(default=-1)
  i42 = db.IntegerProperty(default=-1)
  i43 = db.IntegerProperty(default=-1)
  i44 = db.IntegerProperty(default=-1)
  i45 = db.IntegerProperty(default=-1)
  i46 = db.IntegerProperty(default=-1)
  i47 = db.IntegerProperty(default=-1)
  i48 = db.IntegerProperty(default=-1)
  i49 = db.IntegerProperty(default=-1)
  i50 = db.IntegerProperty(default=-1)
  i51 = db.IntegerProperty(default=-1)
  i52 = db.IntegerProperty(default=-1)
  i53 = db.IntegerProperty(default=-1)
  i54 = db.IntegerProperty(default=-1)
  i55 = db.IntegerProperty(default=-1)
  i56 = db.IntegerProperty(default=-1)
  i57 = db.IntegerProperty(default=-1)
  i58 = db.IntegerProperty(default=-1)
  i59 = db.IntegerProperty(default=-1)
  i60 = db.IntegerProperty(default=-1)
  i61 = db.IntegerProperty(default=-1)
  i62 = db.IntegerProperty(default=-1)
  i63 = db.IntegerProperty(default=-1)
  i64 = db.IntegerProperty(default=-1)
  i65 = db.IntegerProperty(default=-1)
  i66 = db.IntegerProperty(default=-1)
  i67 = db.IntegerProperty(default=-1)
  i68 = db.IntegerProperty(default=-1)
  i69 = db.IntegerProperty(default=-1)
  i70 = db.IntegerProperty(default=-1)
  i71 = db.IntegerProperty(default=-1)
  i72 = db.IntegerProperty(default=-1)
  i73 = db.IntegerProperty(default=-1)
  i74 = db.IntegerProperty(default=-1)
  i75 = db.IntegerProperty(default=-1)
  i76 = db.IntegerProperty(default=-1)
  i77 = db.IntegerProperty(default=-1)
  i78 = db.IntegerProperty(default=-1)
  i79 = db.IntegerProperty(default=-1)
  i80 = db.IntegerProperty(default=-1)
  i81 = db.IntegerProperty(default=-1)
  i82 = db.IntegerProperty(default=-1)
  i83 = db.IntegerProperty(default=-1)
  i84 = db.IntegerProperty(default=-1)
  i85 = db.IntegerProperty(default=-1)
  i86 = db.IntegerProperty(default=-1)
  i87 = db.IntegerProperty(default=-1)
  i88 = db.IntegerProperty(default=-1)
  i89 = db.IntegerProperty(default=-1)
  i90 = db.IntegerProperty(default=-1)
  i91 = db.IntegerProperty(default=-1)
  i92 = db.IntegerProperty(default=-1)
  i93 = db.IntegerProperty(default=-1)
  i94 = db.IntegerProperty(default=-1)
  i95 = db.IntegerProperty(default=-1)
  i96 = db.IntegerProperty(default=-1)
  i97 = db.IntegerProperty(default=-1)
  i98 = db.IntegerProperty(default=-1)
  i99 = db.IntegerProperty(default=-1)
  i100 = db.IntegerProperty(default=-1)      
  created = db.DateTimeProperty(auto_now_add=True)
  updated = db.DateTimeProperty(auto_now=True)  
  owner = db.UserProperty()
  
  
class DataList:
  pass

class ChartParameters:
  pass

class DayOfWeekOffsets:
  pass

class DayOfMonthOffsets:
  pass
